package com.wolfsea.launcherdemo
import com.wolfsea.launcherdemo.databinding.LayoutContentBinding

/**
 *@desc  BottomContentRvAdapter
 *@author liuliheng
 *@time 2022/12/22  10:29
 **/
class LauncherPageRvAdapter(dataSet:MutableList<ContentData>) : BaseRvAdapter<ContentData, LayoutContentBinding>(dataSet) {

    override fun getLayoutId(): Int = R.layout.layout_content

    override fun bindData(holder: ViewHolder, dataItem: ContentData, position: Int) {
        holder.binding.tvContent.text = dataItem.contentDesc
        //val layoutParams = holder.binding.root.layoutParams as RecyclerView.LayoutParams
        //layoutParams.bottomMargin =
        //    if (position == itemCount - 1) holder.binding.root.context.resources.getDimension(R.dimen.dp_10).toInt()
        //    else 0
        //holder.binding.root.layoutParams = layoutParams
        holder.binding.root.setOnClickListener {
            holder.binding.root.context.showToast(dataItem.contentDesc)
        }
    }
}